  ___ _        ___    _ 
 / __| |_  _ _| __|__| |  System font design utility
| (__| ' \| '_| _|/ _` |  Written by Darren Salt
 \___|_||_|_| |___\__,_|  Version 2.11, 7 April 2002


This application allows you to edit up to 16 BBC-style fonts at a time.

Before you read any further, you are advised to run ChrEd then to click once
on its iconbar icon and toggle the window you've just opened to its full
size. The title of the window should be <Untitled>.

The 'current font' is the font in the editing window with the input focus.

The editing window initially displays the edit character (the magnified
image); below left, the normal size version (black on white), which reflects
any changes made to the image above; below right, the currently selected
character (red on cream), which is not affected. Off to the left and below
are various processing options; to the right, the font display and character
selector; below that, two options that decide whether the processing icons
affect the current character or the whole set.

The save box settings (range of characters to be saved) are set up for you
when you load a font or merge two together, and stored when you save the
font.


Simple editing


Just move the pointer over one of the boxes in the edit character and click
Select to set a pixel, or Adjust to clear it.

Storing the edit character


If the current character is not the one in which you want to store the
definition of the edit character, then move the pointer to the character you
want in the character set display to the right and click on it. You will
notice that it now appears in white on black instead of red on cream (the
character immediately below, in black on white, is the redefined version, and
may also be clicked on), and that the current character box also displays
this character. By the way, you can't select Delete.

To store the character, click on the Store icon. The character set display
will be updated to show the change.

If you want to edit the previous definition of the character, click on Swap
instead.

By selecting another character then clicking on Store (or Swap, if
appropriate), it is possible to copy definitions all over the place - even
from one font to another.

Restoring the character to its previous shape and grabbing a new character


If necessary, select a character as described above, then click on Grab.

If its default shape (as in the standard character set or currently defined
system font) is required, click on Default.


Slightly less simple editing


The edit character can be scrolled (with wraparound) in any direction. Just
click on the appropriate arrow.

If you want to reflect the character such that  becomes , click on Flip
X. Or, to change  into , click on Flip Y (and then click on  - I
couldn't come up with a better example).

Character rotation is also easy. Rotate  rotates the character 90
clockwise, Rotate  rotates the character 90 anticlockwise.

To logically invert the character (black becomes white, etc.), click on
Invert.

You can also start afresh by clicking on Clear.

The logic operators AND, OR, EOR


You need to understand a bit about binary and logic operators here. If you
already do, then ignore the following paragraph and the tables following it.

You may be aware that binary is a number base using only two digits, 0 and 1.
Instead of each column representing 1s, 10s, 100s etc, they represent 1s, 2s,
4s, 8s etc. You can think of 0 as off and 1 as on, or white and black -
the possible states of each pixel in the edit character and the current
character. The most relevant part is the logic operators. In the following
tables, the digits down the side represent the possible states of a pixel in
the edit character, and the digits across the top represent the equivalent
pixel in the current character. Think of these as coordinates pointing to one
of the remaining four digits, which represents the resulting pixel state.

AND - 1 if both = 1; OR - 1 if either = 1; EOR - 1 if either, not both, = 1
     0  1               0  1                  0  1
  --+-----            --+-----               --+-----
  0  0  0            0  0  1               0  0  1
  1  0  1            1  1  1               1  1  0

Each operator combines the edit character and the current character
appropriately, and stores the result in the edit character.


The Undo facility


Clicking on the Undo icon will cause the last store, grab, clear, default,
AND, OR, or EOR operation to be undone. Clicking on it again will reverse the
action.


Altering the whole font in one go


Initially, the Character option is selected. In this mode, all the icons to
the left of and below the edit character affect only the edit character.
 Now click on Character set. You will notice that Grab, Store, Swap,
Default, AND, OR, EOR and the arrow icons become unavailable. Also,
the remaining icons now affect the whole font. Altering the font in this way
takes a bit longer to do - hence the hourglass.

The flip, rotate, invert and clear operations is fast enough even on an
ARM250.


Selecting another font to edit


Simple - just edit it. If you use the shortcuts, it's easy enough to tell
which has the input focus.


Saving a font


Click Menu over the editing window and move the pointer to the right of Save
font (for the current font, you can press F3 instead). This will open the
save window, which, for the file icon, the filename entry box to its right,
and the 'OK' button, works in exactly the same way as for any other
application.

Modified fonts are indicated in the usual '*' way.

Using the radio icons, you can select exactly what you want to save...

* All            Selects for saving the definitions for all of the characters
                 (including DELETE);

* Top bit set    The characters shown in the lower four rows of the character
                 set display ('' to '');

* Top bit clear  The rest of the characters (Space to '~');

* Special        User defined. Enter them in the input box immediately below
                 this option; you can specify ranges.

Some of you are probably looking at the save box right now, and are noticing
the toggle size icon. Click on it to extend the window to its full size -
you'll see four buttons. When you're entering the characters you want to
save, click on one of these if you want. The buttons are:

* Normal \   Any special meaning the following character may have is ignored.
             To include it as a character to save, click on it twice!

* To -       Range of characters, starting with the preceding character, and
             ending with the following character. For example, A-Z will
             select all upper case letters for saving.

* Hex       Character code in hexadecimal. There MUST be two hex digits
             following this code.

* Ctrl |     Control sequence. Use |@ for ASCII 0, |A or |a for ASCII 1 ...
             |Z or |z for ASCII 26, |[ or |{ (27), |\ (28), |] or |} (29), |^
             or |~ (30), |_ or |` (31), || (124), |? (127). |! will add 128
             to the following character's code. (This is a subset of the GS
             format.)

You cannot select unprintable characters (ASCII code less than 32) for
saving; if you try to select Delete, it will be omitted.


Loading a font


There are three ways to load a font: double-click on the file, drag it to an
editing window (merging it with the font present in that window), or drag it
to the ChrEd icon.

Any BBC font file can be loaded, provided that the file length is non-zero,
no greater than 2240, and a multiple of 10; and each definition must start
with CHR$ 23 then a printable character. You are told about non-printable
characters and duplicate definitions; these are ignored.


Testing a font


Select Test font from the editing window's menu. The screen will be
automatically redrawn using the font.

To restore the standard font, select Default font.

Needless to say, this won't work if you're using an outline font.


Removing a font


Click on its window's close icon. If there is unsaved data, you'll be asked
if you're sure you don't want to save it.


Exiting the application


Select Quit from the ChrEd icon menu. If there are any unsaved changes,
you will be asked to confirm (Discard) or abandon in order to save the
altered fonts (Cancel).


Shortcuts


In most cases, clicking Adjust on an icon will perform the reverse action.

| represents SHIFT; ^ represents CTRL;     represent the cursor keys.

  Icon      Key(s)        Icon      Key(s)        Icon       Key(s)
  ----      ------        ----      ------        ----       ------
  Flip X    ^X            Default   ^D F9         Scroll    
  Flip Y    ^Y            Clear     ^C Delete     Scroll    
  Rotate   ^Q            AND       &             Scroll    
  Rotate   ^A            OR        +             Scroll    
  Invert    ^I            EOR       *             Character  ^O
  Grab      ^G F7 Copy    Undo      F8            Char. set  ^P
  Store     ^S F6 Insert  Swap      ^W F5

  Key(s)  Function
  ------  --------
 Font editing window
  ^F2     Close editing window (font file)
  F3      Opens the Save box
  Shift or Ctrl + cursor keys
          Select adjacent character in specified direction from current
          character
 Save box
  F1      Equivalent to pressing RETURN or clicking OK
  F2-F5   Equvalent to clicking on a radio icon - F2 = all ... F5 = special
        Move to the other input box (if not greyed out)
  Escape  Close

 Within the character set display:
   SELECT or ADJUST to select the character under the pointer
  Double click:
   SELECT to grab the character definition
   ADJUST to store the edited definition
  Shift-double click:
   SELECT to grab the character's default definition
   ADJUST to swap the character definition with the edited definition

To use a font, *Print it, or load it somewhere in memory and use
  SYS "OS_WriteN",<load address>,<file size>
to set it up.

A definition for Delete is included in files saved using the 'All' option,
though it is never used.


Other alphabets


If the character you selected for editing does not match the character
displayed in the current character box, then you are either not using the UK
(Latin1) character set, or you've defined your own with different characters
and are using it.

I have no plans to change this; however, it is easily done - apply !Paint to
the sprite 'chred_map'. The text should be in ASCII order, 32 characters per
line, width=8, height=8, spacing=9. The text must line up perfectly with the
existing text. You will find it easiest to plot in black, globally change red
to cream, then black to red. Don't remove Delete.

If you made such a change to the sprite 'chred_map0' in an older version,
then save that sprite to the new 'Sprites' file as 'chred_map'.


Contact
=======

<URL:mailto:ds@youmustbejoking.demon.co.uk>
<URL:http://www.youmustbejoking.demon.co.uk/>
